﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using TotalApplication.Core;
using TotalApplication.viewmodels.Video;

namespace TotalApplication.Mine_Video
{
    /// <summary>
    /// TagList.xaml 的交互逻辑
    /// </summary>
    public partial class TagList : UserControl
    {
        public TagList()
        {
            InitializeComponent();
        }

        private void UserControl_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            if (DataContext is viewmodels.Video.Controls.TagLIstVM vm)
            {
                if(IoC.Get<TagsVM>().Tags != vm)
                {
                    IoC.Get<TagsVM>().Tags = vm;
                }
            }
        }

        private void ScrollViewer_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (DataContext is viewmodels.Video.Controls.TagLIstVM vm)
            {
                if (IoC.Get<TagsVM>().Tags != vm)
                {
                    IoC.Get<TagsVM>().Tags = vm;
                }
                IoC.Get<TagsVM>().Tags.ExpandClose();
                e.Handled = true;
            }
        }
    }
}
